﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Net;
using ServerLibrary.Infrastructure;
namespace ServerLibrary.Abstract
{
    /// <summary>
    /// Task entity.
    /// </summary>
   
    public interface ITask
    {
        /// <summary>
        ///Gets or sets http request
        /// </summary
        HttpListenerRequest Request { get; set; }

        /// <summary>
        /// Gets or sets http response
        /// </summary
        HttpListenerResponse Response { get; set; }

        /// <summary>
        /// Runs the task
        /// </summary>
        /// <param name="threadContext">Parameter for ThreadPool queue</param>
        void Run(object threadContext);


        /// <summary>
        /// Raises when task finished
        /// </summary>
        event TaskDoneHandler TaskDone;
    }
}
